home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / cntour06 < prev    next >
Text File  |  1997-07-08  |  1KB  |  36 lines

  1. ; This batch file creates a contour plot and a 2-D plot using
  2. ; a three-dimensional transformation. This example is from
  3. ; Chapter 11, "Plotting Multi-dimensional Arrays", of _Using IDL_.
  4.  
  5. ; Create the Z variable
  6. Z = SHIFT(DIST(40), 20, 20)
  7. Z = EXP(-(Z/10)^2)
  8.  
  9. ; NX and NY are the X and Y dimensions of the Z array
  10. NX = (SIZE(Z))(1)
  11. NY = (SIZE(Z))(2)
  12.  
  13. ; Set up !P.T with default SURFACE transformation.
  14. SCALE3
  15.  
  16. ; Define the three-dimensional plot window: x = 0.1 to 1, Y=0.1 to 1,
  17. ; and z = 0 to 1.
  18. POS=[.1, .1, 1, 1, 0, 1]
  19.  
  20. ; Make the stacked contours. Use 10 contour levels. 
  21. CONTOUR, Z, /T3D, NLEVELS=10, /NOCLIP, POSIT=POS, CHARSIZE=2
  22.  
  23. ; Swap y and z axes. The original xyz system is now xzy.
  24. T3D, /YZEXCH
  25.  
  26. ; Plot the column sums in front of the contour plot.
  27. PLOT, Z#REPLICATE(1., NY), /NOERASE, /NOCLIP, /T3D, $
  28.     TITLE='COLUMN SUMS', POSITION = POS, CHARSIZE = 2
  29.  
  30. ; Swap x and z-original xyz is now yzx
  31. T3D, /XZEXCH
  32.  
  33. ; Plot the row sums along the right side of the contour plot. 
  34. PLOT, REPLICATE(1., NX)#Z, /NOERASE, /T3D, /NOCLIP, $
  35.     TITLE = 'ROW SUMS', POSITION = POS, CHARSIZE = 2
  36.